CREATE TABLE [dbo].[tb_Incumbencias]
(
[idIncumbencia] [int] NOT NULL IDENTITY(1, 1),
[GrupoIncumbencia] [int] NOT NULL,
[CargoGenerico] [int] NOT NULL,
[AsignaturaGenerica] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Incumbencias] ADD CONSTRAINT [PK_tb_Incumbencias] PRIMARY KEY CLUSTERED  ([idIncumbencia]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [ind_GrupoCargoAsignatura] ON [dbo].[tb_Incumbencias] ([GrupoIncumbencia], [CargoGenerico], [AsignaturaGenerica]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Incumbencias] WITH NOCHECK ADD CONSTRAINT [FK_tb_Incumbencias_tb_AsignaturasGenericas] FOREIGN KEY ([AsignaturaGenerica]) REFERENCES [dbo].[tb_AsignaturasGenericas] ([idAsignaturaGenerica])
GO
ALTER TABLE [dbo].[tb_Incumbencias] WITH NOCHECK ADD CONSTRAINT [FK_tb_Incumbencias_tb_CargosGenericos] FOREIGN KEY ([CargoGenerico]) REFERENCES [dbo].[tb_CargosGenericos] ([idCargoGenerico])
GO
ALTER TABLE [dbo].[tb_Incumbencias] WITH NOCHECK ADD CONSTRAINT [FK_tb_Incumbencias_tb_GruposDeIncumbencias] FOREIGN KEY ([GrupoIncumbencia]) REFERENCES [dbo].[tb_GruposDeIncumbencias] ([idGrupoIncumbencia])
GO
